<template>
  <top-nav />
  <div class="page">
    <ul v-if="menuVisible">
      <li class="text">文档</li>
      <li><router-link to="/page/start">start</router-link></li>
      <li><router-link to="/page/intro">intro</router-link></li>
      <li><router-link to="/page/install">install</router-link></li>
      <li class="text">组件列表</li>
      <li><router-link to="/page/SwitchDemo">Switch组件</router-link></li>
      <li><router-link to="/page/dialogDemo">Dialog组件</router-link></li>
      <li><router-link to="/page/tabDemo">Tab组件</router-link></li>
      <li><router-link to="/page/stepDemo">Step组件</router-link></li>
      <li><router-link to="/page/tagDemo">Tag标签</router-link></li>
      <li><router-link to="/page/selectDemo">Select选择器</router-link></li>
    </ul>
    <main>
      <router-view />
    </main>
  </div>
</template>
<script lang="ts">
import { defineComponent, inject, Ref } from "vue";
import topNav from "../components/topNav.vue";

export default defineComponent({
  components: { topNav },
  setup() {
    const menuVisible = inject<Ref<boolean>>("menuVisible");
    return { menuVisible };
  },
});
</script>

<style scoped lang="scss">
.page {
  display: flex;
  margin-top: 10px;
  ul {
    flex-grow: 0;
    min-width: 100px;
    background-color: cadetblue;
    margin-right: 10px;
    padding-bottom: 10px;
    @media (max-width: 500px) {
      position: fixed;
    }
    li {
      line-height: 30px;
      .router-link-exact-active {
        background-color: wheat;
      }
      a {
        width: 90%;
        display: inline-block;
        padding-left: 10px;
      }
    }
    .text {
      font-size: 20px;
      font-weight: 600;
      padding: 8px 0 0 10px;
    }
  }
  main {
    flex-grow: 1;
    background-color: wheat;
    padding: 10px;
  }
}
ul,
li {
  padding: 0;
  margin: 0;
  list-style: none;
}
</style>
